home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: a1s@ix.netcom.com (Andrew Snyder)
- Newsgroups: comp.lang.c
- Subject: Re: Object Oriented programming in C ????
- Date: Wed, 06 Mar 1996 22:18:27 GMT
- Organization: Netcom
- Message-ID: <4hkor1$3pu@dfw-ixnews1.ix.netcom.com>
- References: <4higq7$5j2@sidhe.memra.com>
- NNTP-Posting-Host: har-ct1-22.ix.netcom.com
- X-NETCOM-Date: Wed Mar 06 1:25:21 PM CST 1996
- X-Newsreader: Forte Free Agent 1.0.82
-
- michael@memra.com (Michael Dillon) wrote:
-
- >Does anyone know of resources that explain how to write OO programs in C?
- >I know about C++ and Objective C and I don't like either one. I would
- >like to be able to write OO programs in straight C (with some
- >preprocessor help for syntactic sugar) so that my code is fully portable
- >between a number os OS's.
-
- >--
- >Michael Dillon Voice: +1-604-546-8022
- >Memra Software Inc. Fax: +1-604-546-3049
- >http://www.memra.com E-mail: michael@memra.com
-
- There is no magic to OO design that requires a particular language,
- all you need to do is hide the implementation of your "objects" behind
- a set of function calls. The file handling provided by "stdio.h" is a
- good example:
-
- 1) All possible operations on files map to a paticular function call.
- 2) The detail of files are "hidden" from the user-programmer.
- 3) Files can be different things on different systems (i.e. disk file,
- pipe, tape drive)
-
- What an OO language will get you is better support for things like
- initialization, real information hiding, type checking, etc.
-
- Just build a function library and hide as much stuff as you can with
- static variables. Be sure to include the libraries header file in
- every c file to catch errs.
- Andrew Snyder
- a1s@ix.netcom.com
- char disclaimer[] = {'\0'}; /* I'm on cash net */
-
-